import {reqindexdata} from '../../api/index.js'
Page({
  data:{
    bannerlist:[],
    categorylist:[],
    activelist:[],
    hotlist:[],
    guesslist:[],
  },
  async getindexdata(){
    const res=await reqindexdata()
    this.setData({ 
      bannerlist:res[0].data,
      categorylist:res[1].data,
      activelist:res[2].data,
      guesslist:res[3].data,
      hotlist:res[4].data,
      loading:true,
      loading:false
    })
  },
  async onShow(){
    await this.getindexdata()
  },
  async onPullDownRefresh(){
    await this.getindexdata()
    wx.stopPullDownRefresh()
  },
  onShareAppMessage(){
    return {
      title:"分享页面",
      path:"/pages/index/index"
    }
  },
  onShareTimeline(){}
})
